package com.customization.unionpay.market.dao;

import com.alibaba.fastjson.JSONObject;
import weaver.backup.logging.Logger;
import weaver.backup.logging.LoggerFactory;
import weaver.conn.RecordSet;

import java.util.ArrayList;
import java.util.List;

public class WorkflowRequestbaseDao {

    public Logger log = LoggerFactory.getLogger(WorkflowRequestbaseDao.class);
    public List<JSONObject> queryById (int requestId) {
        StringBuilder sb = new StringBuilder();
        sb.append("SELECT lastoperatetime FROM workflow_requestbase WHERE requestid=").append(requestId);
        try {
            RecordSet rs = new RecordSet();
            rs.execute(sb.toString());
            List<JSONObject> list = new ArrayList<>();
            while (rs.next()) {
                JSONObject o = new JSONObject();
                o.put("zxrq", rs.getString("lastoperatetime"));
                list.add(o);
            }
            return list;
        } catch (Exception e) {
            log.error("获取流程最后操作时间失败");
        }
        return null;
    }
}
